﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/inc/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>租拍吧</title>
		<link href="/css/style.css" rel="stylesheet" type="text/css" />
		<link href="/css/common.css" rel="stylesheet" type="text/css" />
		<link href="/css/mblog.css" rel="stylesheet" type="text/css" />
		<link href="/css/memberleft.css" rel="stylesheet" type="text/css" />
		<script src="/js/jquery-1.4.2.min.js" type="text/javascript"></script>
		<script type="text/javascript" src="/js/form/jquery.form.js"></script>
		<script src="/js/wbox.js" type="text/javascript"></script>
		<link href="/css/wbox/wbox.css" rel="stylesheet" type="text/css" />
		<script src="/js/prettydate.js"></script>
		<script src="/js/miniblog.js"></script>
		<script src="/js/common.js"></script>
		
		<script type="text/javascript">
			var path = "${path}";
		</script>
		<script type="text/javascript" src="${path }/js/dialog/zDialog.js"></script>
		<script type="text/javascript" src="${path }/js/dialog/zDrag.js"></script>
		<script> 
			$(function(){
				template = '<dd id="{id}"><div class="msg"><div class="msg_pic"><img src="{pic}"/></div><div class="msg_txt"><div class="msg_username"><a href="{link}">{username}</a></div><div class="msg_content">{text}</div><div class="msg_info">{pretty_time}</div></div></div></dd>';
		  		t_update(template,4);
		  		
		  		var options = {
					beforeSubmit: checkForm,
					dataType : 'json',
					success:addBack
				};
						
				$('#loginForm').ajaxForm(options); 
				
				$("#pubMsgBut").wBox({title:"我来吼一下",requestType: "iframe",target:"/message/publish"});
				
				$("#goCart").wBox({title:"",requestType: "iframe",target:"/cart"});
					  	
			});
			
			function checkForm(){
				$("#info").html("正在登录..");
				//return false;
			}
					
			function addBack(json){
				if(json.result=="Success"){
					document.location = "/index";
				}else if(json.result == "Faile" && json.ErrorCode == "-1"){
					$("#info").html("用户不存在!");
				}else if(json.result == "Faile" && json.ErrorCode == "-2"){
					$("#info").html("密码错误!");	
				}
			}
			
			
		</script>

	</head>

	<body>
		<!--top part start -->
		<div id="toppart">
			
			<div id="leftPart">
				<a href="index.htm"><img src="" alt="Bluish"
						width="195" height="45" class="logo" /> 
				</a>
				<div class="cartNumbox">
					购物车有<span id="cartAmount"></span>件商品,<a id="goCart" href="">去结算</a>
					<script type="text/javascript">
						
					</script>
				</div>
				<div class="login_box">
					<c:if test="${member == null }">
							<h2 >会员登录</h2><span id="info"></span>
							<form action="/member/login" method="post" name="loginForm" id="loginForm">
								<table width="100%">
									<tr>
										<td>
											用户名:
										</td>
										<td>
											<input type="text" name="memberName" size="10"/>
										</td>
									</tr>
									<tr>
										<td>
											用户密码:
										</td>
										<td>
											<input type="password" name="memberPwd" size="10"/>
										</td>
									</tr>
									<tr>
										<td colspan="2">
											<input type="submit" value="登录"/>
										</td>
									</tr>
								</table>
							</form>
					</c:if>
					<c:if test="${member != null }">
							<h2>欢迎你，${member.memberRealName }</h2>
							<div>
								<img src="/picture/show/${member.memberPhoto }?w=100&h=100" width="100px" height="100px"/>
							</div>
							
							<div class="left"> 
							    <div class="left_box1">
							    	<ul>
										<li>
											<c:if test="${myOrderTotal > 0 }">
											<a id="myOrder" href="javascript:void(0)" class="current">我的申请</a></li>
											</c:if>
										<li><a id="myGoodsOrder" href="javascript:void(0)">我的订单</a></li>
										<li><a href="javascript:void(0)">我的好友</a></li>
										<li><a href="javascript:void(0)" onclick="/member/logout">注销</a></li>								
									</ul>
									<script type="text/javascript">
										$("#myOrder").wBox({title:"我的申请",requestType: "iframe",target:"/order/my/show"});
										$("#myGoodsOrder").wBox({title:"我的订单",requestType:"iframe",target:"/goods/order/my/list/${member.memberName}"});
									</script>
							    </div>
							</div> 
							
								
							
					</c:if>
				
				</div>
				
				
				
				<div class="new_goods_box">
					<h2>最新商品</h2></br>
					<c:forEach items="${newGoods10}" var="newGoods">
						<div class="new_goods_cont">
							<div class="new_goods_img">
								<a href="" id="link${newGoods.goodsId}"><img src="/picture/show/${newGoods.goodsImg }?w=60&h=60" width="60px" height="60px"/></a>
								<script type="text/javascript">
									$("#link"+${newGoods.goodsId}).wBox({title:"",requestType: "iframe",target:"/goods/${newGoods.goodsNo }"});
								</script>
							</div>
							<div class="new_goods_inf">
								<div >宝贝名称:${newGoods.goodsName }</div>
								<div>宝贝价钱:￥${newGoods.shopPrice }</div>
							</div>
						</div>
					</c:forEach>
				</div>
			
			</div>
			<!--right part start -->
			<div id="right">
				<!--top ul start-->
				<div id="rightTop">
					<%@ include file="/inc/top.jsp" %>
				</div>
				<!--top ul end -->
				
				<!--what more start -->
				<div id="rightmid">
					
					<div class="user_box">
						<div class="user_pic">
							<c:if test="${managerUser !=null}">
								<img src="/picture/show/${managerUser.memberPhoto }?w=100&h=100" />
							</c:if>
							
							<c:if test="${member != null }">
							<div class="btn btn_try">
								<a href="javascript:void(0)" onclick="openOrder()">申请</a><span></span>
							</div>
							</c:if>
						</div>
						<div class="user_info">
							<c:if test="${manager !=null}">
								<span>今日店主</span>
								<div>
									用户名:${manager.orderMember }
								</div>
								<div>
									昵称:${managerUser.memberRealName }
								</div>
								
								<div>
									开店日期:${manager.orderRequestYear }-${manager.orderRequestMonth }-${manager.orderRequestDay }
								</div>
								<div>
									到期日期:${manager.orderEndYear }-${manager.orderEndMonth }-${manager.orderEndDay }
								</div>
							</c:if>
							<c:if test="${manager == null}">
								<div>
									今日无店主打理
								</div>
							</c:if>
						</div>
						<div class="product_info">
							<c:if test="${manager != null}">
								<span>镇店之宝</span>
								<c:if test="${shopBaby !=null}">
									<div class="goods_img">
										<img src="/picture/show/${shopBaby.goodsImg }?w=100&h=100" />
									</div>
									<div class="goods_info">
										<div>宝贝名称:${shopBaby.goodsName }</div>
										<div>宝贝价钱:￥${shopBaby.shopPrice }</div>
									</div>
								</c:if>
							</c:if>
							
						</div>
					</div>
					
					<c:if test="${! empty auctionGoods10}">
						<div id="auctionGoods10" class="auction_goods_10">
							<div class="special">
								<div class="mt"> 
									<h2>最新拍卖</h2> 
									<div class="extra"></div> 
								</div> 
								<div class="mc">
									<ul class="list-h"> 
										<c:forEach items="${auctionGoods10}" var="auction">
											<li class='fore'> 
												<div class="p-img">
													<a id="auctionLink${auction.goodsId }" href='#'>
														<img src='/picture/show/${auction.goodsImg }?w=100&h=100'  alt='' />
													</a>
													<script type="text/javascript">
														$("#auctionLink"+${auction.goodsId}).wBox({title:"",requestType: "iframe",target:"/goods/${auction.goodsNo }"});
													</script>
												</div> 
												<div class="p-name">
													<a target="_blank" href='#'>
														${auction.goodsName }
													</a>
												</div> 
												<div class="p-price">
													拍卖日期：<strong><fmt:formatDate  value="${auction.auctionDate }"  pattern="yyyy-MM-dd" /></strong>
												</div> 
											</li> 
										</c:forEach>
									</ul>
								</div>
							</div>
						</div>
					</c:if>
					
					<div class="message_list">
						<dl id="divmsg" class="msgdiv">
							<dt class="txt_blue">最新消息<span><a id="pubMsgBut" href="test.html" >吼一句</a></span></dt>
						</dl>
					</div>
				</div>
				<!--what more end -->
				<br class="spacer" />
			</div>
			<!--right part end -->
			<br class="spacer" />
		</div>
		<!--top part end -->

		<!--footer start -->
		<div id="footerMain">

			<div id="footer">
				<%@ include file="/inc/top.jsp" %>
			</div>
		</div>
		<!--footer end -->
		
		
	</body>
	
</html>
